import WConio

def setup():
    old_setting = WConio.gettextinfo()[4] & 0x00FF  #Store current attribute settings
    WConio.clrscr()                                 #Clear the screen

def display():
    WConio.gotoxy(5,5)
    WConio.cputs("High video\r\n")

    WConio.textattr(WConio.LIGHTRED)                #Display some red text
    WConio.cputs("Light Red text\r\n")

    WConio.highvideo()                              #Make the text lighter
    WConio.textattr(WConio.LIGHTBLUE)               #Display some light blue text
    WConio.cputs("Light BLUE text\r\n")

    print                                           #Print a blank line
    print 'Press Q to Quit'

def keyloop():
    while True:
      key = WConio.getkey()
      if key == 'k':
        print 'k was pressed'
        key = None
      elif key == 'l':
        print 'l was pressed'
        key = None
      elif key == 'q':
        break
      else:
        pass

setup()
display()
keyloop()

#Retore old attribute settings
WConio.textattr(old_setting)
